<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'mortgage.label', default: 'Mortgage')}"/>
    <title>押品待办</title>
    <style>
    .table>tbody>tr>td{
        vertical-align: middle;
    }
    @media screen and (min-width:1900px) and (max-width:1920px) {
        .flex{
            display: flex;justify-content: center;align-items: center;
        }
    }
    .select2-container .select2-choices .select2-search-field input,.select2-container .select2-choice,.select2-container .select2-choices{

        color: #999;
    }
    </style>
</head>

<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right navFloatRight">
                <ol class="hbreadcrumb breadcrumb">
                    <li>
                        <span>CINDTATA PLS</span>
                    </li>
                    <li>
                        <span>押品待办</span>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="collateralPending" class="form-horizontal" role="form" id="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit" onclick=""><i class="fa fa-search"></i> 查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i> 重置</button>
                    </div>
                    查询
                </div>
                <div class="panel-body seach-group" id="bug1">

                    <input type="hidden" name="flag" value="${this.params?.flag}">
                    <input type="hidden" name="status" value="${this.params?.status}">

                    <div class="row ">
                        <div class="form-group col-sm-3">
                            <label for="district" class="col-sm-3 control-label">押品编号</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="externalId" id="externalId" value="${params?.externalId}" placeholder="请输入押品编号">
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">房屋用途</label>
                            <div class="col-sm-9">
                                <g:select class="form-control" name="buildingType" id="buildingType"
                                          from="${com.cindata.dictionary.BuildingTypeDict.listOrderById()}"
                                          valueMessagePrefix="status" optionKey="id" optionValue="name"
                                          value="${params?.buildingType}"
                                          noSelection="${['': '请选择房屋用途']}"/>
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label for="district" class="col-sm-3 control-label">押品地址</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="sourceAddress" id="sourceAddress" value="${params?.sourceAddress}" placeholder="请输入押品地址">
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">工作流</label>
                            <div class="col-sm-9">
                                <g:select class="form-control" name="workflow" id="workflow"
                                  from="${com.cindata.Workflow.findAllByType(com.cindata.dictionary.WorkflowType.findByName('押品'))}"
                                  valueMessagePrefix="status" optionKey="id" optionValue="name"
                                  value="${params?.workflow}"
                                  noSelection="${['': '请选择工作流']}"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </g:form>
    </div>

        <div class="row">
            <div class="hpanel hgreen">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <sec:ifAllGranted roles="ROLE_CUSTOMER_MANAGER">
                            <g:link action="estateCreate" controller="estate" class="btn btn-info btn-xs"><i class="fa fa-plus"></i>新建</g:link>
                        </sec:ifAllGranted>
                        <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                    </div>
                    &nbsp;&nbsp;
                </div>

                <div class="panel-body no-padding">
                    <div class="table-responsive">
                        <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center" id="esateTable">
                            <thead>
                            <tr>
                                <g:sortableColumn property="externalId" title="押品编号" params="${params}"/>
                                <g:sortableColumn property="buildingType" title="房屋用途" params="${params}"/>
                                <g:sortableColumn property="city" title="城市" params="${params}"/>
                                <g:sortableColumn property="district" title="行政区" params="${params}"/>
                                <g:sortableColumn property="sourceAddress" title="押品地址" params="${params}"/>
                                <g:sortableColumn property="workflowName" title="工作流名称" params="${params}"/>
                                <g:sortableColumn property="workflow" title="工作流" params="${params}"/>
                                <g:sortableColumn property="name" title="当前阶段" params="${params}"/>
                                <g:sortableColumn property="city" title="当前状态" params="${params}"/>
                                <g:sortableColumn property="district" title="创建时间" params="${params}"/>
                                <g:sortableColumn property="fullName" title="修改时间" params="${params}"/>
                            </tr>
                            </thead>
                            <tbody>
                            <g:each in="${workflowInstanceUserList}">
                                <tr>
                                    <td ><g:link style="color: #3498DB" controller="estate" action="estateShow" class="firstTd" id="${it[0]}">${it[1]}</g:link></td>
                                    <td>${it[7]?.estate?.buildingType?.name}</td>
                                    <td>${it[7]?.estate?.city?.name}</td>
                                    <td>${it[7]?.estate?.district?.name}</td>
                                    <td>${it[7]?.estate?.sourceAddress}</td>
                                    <td>${it[2]}</td>
                                    <td>${it[8]?.workflow?.name}</td>
                                    <td>${it[3]}</td>
                                    <td>${it[4]}</td>
                                    <td><g:formatDate date="${it[5]}" format="yyyy-MM-dd HH:mm:ss" ></g:formatDate></td>
                                    <td><g:formatDate date="${it[6]}" format="yyyy-MM-dd HH:mm:ss" ></g:formatDate></td>
                                </tr>
                            </g:each>
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="panel-footer">
                    <div class="pagination">
                        <g:paginate action="estatePendingIndex" total="${count ?: 0}" params="${params}"/>
                    </div>
                </div>
            </div>
        </div>
    </div>

<g:javascript>
    //重置按钮
    $("#resetBtn").click(function () {
        $("#externalId").val("");
        $("#sourceAddress").val("");
        $("#buildingType").val("");
        $('#s2id_buildingType span:first').html('请选择房屋用途');
        $("#workflow").val("");
        $('#s2id_workflow span:first').html('请选择工作流');
    });
</g:javascript>
</body>
</html>
